const user = {
    namespaced: true,
    actions: {
        // function(context,value){

        // }
    },

    mutations: {
        // function(state,value){

        // }
		setToken(state,value){
			state.token = value
		},
		setUserInfo(state,value){
			state.userinfo = JSON.parse(value)
		},
		logout(state,value){
			state.token = '',
			state.userinfo = {}
		},
    },
	
	getters:{
		userImg(state){
			return state.userinfo.userImg
		},
		id(state){
			return state.userinfo.id
		},
		userName(state){
			return state.userinfo.userName
		},
		bgImg(state){
			return state.userinfo.bgImg
		}
	},
	

    state: {
        //    key:value
		token:'',
        userinfo: {},
    }
}

export default user